<%@ page language="java" import="java.util.*,com.model.DoorOrder" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/punishment.css">
<style type="text/css">
table {
	border-collapse: collapse;
	border-spacing: 0;
}

td, th {
	padding: 0;
}

.pure-table {
	border-collapse: collapse;
	border-spacing: 0;
	empty-cells: show;
	border: 1px solid #cbcbcb;
}

.pure-table caption {
	color: #000;
	font: italic 85%/1 arial, sans-serif;
	padding: 1em 0;
	text-align: center;
}

.pure-table td, .pure-table th {
	border-left: 1px solid #cbcbcb;
	border-width: 0 0 0 1px;
	font-size: inherit;
	margin: 0;
	overflow: visible;
	padding: .5em 1em;
}

.pure-table thead {
	background-color: #e0e0e0;
	color: #000;
	text-align: left;
	vertical-align: bottom;
}

.pure-table td {
	background-color: transparent;
}

.pure-table-odd {
	background-color: #f2f2f2;
}
</style>
</head>
<body>
	
	<div class="container">
		<div class="content">
			<div class="header clearfix">
				<div class="top fl">当前位置>预约订单</div>
			</div>
			<div class="main">
				<!--基础信息-->
				<div class="BasicInformation">
					<div class="title">预约订单</div>
				</div>
				<form action="EmployeeServlet" method="post">
						<input type="text" name="uname" value="" style="margin:5px" placeholder="请输入顾客姓名">
						<input type="hidden" name="action" value="query">
						<input type="submit"  value="搜索" style="height:30px;margin:5px">
					</form>
				<!--在此处添加表格-->
				<div class="pure-table">
					<table>
						<thead>
							<tr>
								<th>顾客编号</th>
								<th>顾客姓名</th>
								<th>顾客电话</th>
								<th style="width:85px">顾客地址</th>
								<th >预约的时间</th>
								<th style="width:100px">订单编号</th>
							</tr>
						</thead>
						<tbody>
						  
							<c:forEach items="${requestScope.doors }" var ="door">
								<tr>
									<td>${door.uid}</td>
									<td>${door.uname}</td>
									<td>${door.uphone}</td>
									<td>${door.uaddress}</td>
									<td>${door.destinetime}</td>
									<td>${door.oid} </td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	<script src="js/jquery-1.9.1.min.js"></script>
	<script>
		//控制表格的单双行的背景颜色
	   	$(".pure-table tr:even").addClass("pure-table-odd");
	
        $('select').attr('value','0');
        $.ajax({
            url: "http://101.201.154.205:9090/survey/getSurveyByStuId",
            data: {
                stuId:1,
                t: Math.random()
            },
            type: 'get',
            dataType: 'jsonp',
            'jsonp': 'callback'
            }).then(function (res) {
            $('select option').each(function(index,arg){
                if($(this).val() == res.entrance){
                    $(this).attr('selected','selected');
                }
            });
            $('select').attr('value',res.entrance);
            $('#expect_salary').attr('value',res.expect_salary);
            $('#situation').text(res.situation);
            $('#city').attr('value',res.city);
            $('#work_pro').attr('value',res.work_pro);
            $('#remarks').attr('value',res.remarks);
            $('#unit_pro').attr('value',res.unit_pro);
            $('#province').attr('value',res.province);


        },function (err) {
            console.log(err);
        });
        $('.l').click(function () {
            $('.oInp').removeAttr('disabled');
        });

        $('.r').click(function () {
            $('.oInp').attr('disabled','disabled');

            $.ajax({
                url: "http://101.201.154.205:9090/survey/surveyUpdateDo",
                data: {
                    stu_id:"1",
                    expect_salary:$('#expect_salary').val(),
                    entrance:$('select').val(),
                    remarks:$('#remarks').val(),
                    province:$('#province').val(),
                    city:$('#city').val(),
                    situation:$('#situation').val(),
                    work_pro:$('#work_pro').val(),
                    unit_pro:$('#unit_pro').val(),
                    t: Math.random()
                },
                type: 'get',
                dataType: 'jsonp',
                'jsonp': 'callback'
            }).then(function (res) {
                console.log(res);

            },function (err) {
                console.log(err);
            });


        });
        
		
        
        

    </script>

</body>
</html>
